//
//  GMBuyMoneyCell.m
//  Teecloud
//
//  Created by 小熊 on 2018/10/26.
//  Copyright © 2018年 小志. All rights reserved.
//

#import "GMBuyMoneyCell.h"
@interface GMBuyMoneyCell()
@property (weak, nonatomic) IBOutlet UIView *view1;
@property (weak, nonatomic) IBOutlet UILabel *title1;
@property (weak, nonatomic) IBOutlet UILabel *count1;
@property (weak, nonatomic) IBOutlet UIView *view2;
@property (weak, nonatomic) IBOutlet UILabel *title2;
@property (weak, nonatomic) IBOutlet UILabel *count2;
@property (weak, nonatomic) IBOutlet UIView *view3;
@property (weak, nonatomic) IBOutlet UILabel *title3;
@property (weak, nonatomic) IBOutlet UILabel *count3;
@property (weak, nonatomic) IBOutlet UIView *view4;
@property (weak, nonatomic) IBOutlet UILabel *title4;
@property (weak, nonatomic) IBOutlet UILabel *count4;
@property (weak, nonatomic) IBOutlet UILabel *money;
@property (weak, nonatomic) IBOutlet UIView *nameView;
@property (weak, nonatomic) IBOutlet UILabel *name;

@end
@implementation GMBuyMoneyCell

- (void)awakeFromNib {
    [super awakeFromNib];
}
-(void)setModel:(GMCommentBaseModel *)model{
    _model = model;
    if (kIsEmptyString(model.tempStr)) {
        self.nameView.hidden = YES;
    }else{
        self.nameView.hidden = NO;
        self.name.text = model.tempStr;
    }
//    self.money.text = [NSString stringWithFormat:@"%.2f",model.Price];
//    self.money.text = @"";
    if ([model.ResType isEqualToNumber:@(1)]){
        /**视频*/
        self.title1.text = @"播放";
        self.title2.text = @"习题";
        self.title3.text = @"附件";
        self.title4.text = @"购买";
        self.count1.text = [NSString stringWithFormat:@"%@",model.PlayCount];
        self.count2.text = [NSString stringWithFormat:@"%@",model.ExerCount];
        self.count3.text = [NSString stringWithFormat:@"%@",model.AttachCount];
        self.count4.text = [NSString stringWithFormat:@"%@",model.BuyCount];
        
    }else if ([model.ResType isEqualToNumber:@(2)]){
        /**文档*/
       self.title1.text = @"阅读";
       self.title2.text = @"习题";
       self.title3.text = @"附件";
       self.title4.text = @"购买";
       self.count1.text = [NSString stringWithFormat:@"%@",model.PlayCount];
       self.count2.text = [NSString stringWithFormat:@"%@",model.ExerCount];
       self.count3.text = [NSString stringWithFormat:@"%@",model.AttachCount];
       self.count4.text = [NSString stringWithFormat:@"%@",model.BuyCount];
       
    }else if ([model.ResType isEqualToNumber:@(3)]){
        /**习题*/
        self.title1.text = @"练习";
        self.title2.text = @"题目";
        self.title3.text = @"附件";
        self.title4.text = @"购买";
        self.count1.text = [NSString stringWithFormat:@"%@",model.PlayCount];
        self.count2.text = [NSString stringWithFormat:@"%@",model.ExerCount];
        self.count3.text = [NSString stringWithFormat:@"%@",model.AttachCount];
        self.count4.text = [NSString stringWithFormat:@"%@",model.BuyCount];
       
    }else if ([model.ResType isEqualToNumber:@(4)]){
        /**试卷*/
        self.title1.text = @"测试";
        self.title2.text = @"题目";
        self.title3.text = @"附件";
        self.title4.text = @"购买";
        self.count1.text = [NSString stringWithFormat:@"%@",model.PlayCount];
        self.count2.text = [NSString stringWithFormat:@"%@",model.ExerCount];
        self.count3.text = [NSString stringWithFormat:@"%@",model.AttachCount];
        self.count4.text = [NSString stringWithFormat:@"%@",model.BuyCount];
    
    }else if ([model.ResType isEqualToNumber:@(9)]){
        /**课程包*/
        self.title1.text = @"查看";
        self.title2.text = @"购买";
        self.title3.text = @"";
        self.title4.text = @"";
        self.count1.text = [NSString stringWithFormat:@"%@",model.PlayCount];
        self.count2.text = [NSString stringWithFormat:@"%@",model.BuyCount];
        self.count3.text = @"";
        self.count4.text = @"";
    }
}

@end
